package view.CommonView;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JLabel;

import view.MainView;


/**
 * @Author: Lin Hongwei
 * @LastEditors: Lin Hongwei
 * @email: 1365755396@qq.com
 * @CSDN: https://blog.csdn.net/weixin_45429409
 * @Description: 封装用户信息显示公用模块。用于在借阅还书模块中显示
 *
 */
public class CommonBookInfoView extends CommonJPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static JLabel bookNameTxt, bookAuthorTxt, bookPressTxt, bookPressTimeTxt,bookPrriceTxt,bookStockTxt;

	public CommonBookInfoView() {
		super(TYPE_TRANSPARENT);

		setLayout(new FlowLayout(FlowLayout.CENTER, 30, 20));
		setPreferredSize(new Dimension(MainView.instance.getWidth(), 140));

		int width = MainView.instance.getWidth() / 2 - 180;

		// 创建图书名称
		JLabel labelBookName = new JLabel("图书信息：");
		labelBookName.setPreferredSize(new Dimension(80, 20));
		add(labelBookName);
		bookNameTxt = new JLabel("谢谢谢谢");
		bookNameTxt.setPreferredSize(new Dimension(width, 20));
		bookNameTxt.setForeground(Color.RED);
		add(bookNameTxt);
		// 创建图书名称
		JLabel labelBookAuthor = new JLabel("作者：");
		labelBookAuthor.setPreferredSize(new Dimension(80, 20));
		add(labelBookAuthor);
		bookAuthorTxt = new JLabel("哈哈哈");
		bookAuthorTxt.setPreferredSize(new Dimension(width, 20));
		bookAuthorTxt.setForeground(Color.RED);
		add(bookAuthorTxt);
		// 创建出版社
		JLabel labelBookPress = new JLabel("出版社：");
		labelBookPress.setPreferredSize(new Dimension(80, 20));
		add(labelBookPress);
		bookPressTxt = new JLabel("出版社区");
		bookPressTxt.setPreferredSize(new Dimension(width, 20));
		bookPressTxt.setForeground(Color.RED);
		add(bookPressTxt);
		// 出版时间
		JLabel labelBookPressTime = new JLabel("出版时间：");
		labelBookPressTime.setPreferredSize(new Dimension(80, 20));
		add(labelBookPressTime);
		bookPressTimeTxt = new JLabel("出版时间--");
		bookPressTimeTxt.setPreferredSize(new Dimension(width, 20));
		bookPressTimeTxt.setForeground(Color.RED);
		add(bookPressTimeTxt);
		// 定价
		JLabel labelBookPrice = new JLabel("定价：");
		labelBookPrice.setPreferredSize(new Dimension(80, 20));
		add(labelBookPrice);
		bookPrriceTxt = new JLabel("29.22");
		bookPrriceTxt.setPreferredSize(new Dimension(width, 20));
		bookPrriceTxt.setForeground(Color.RED);
		add(bookPrriceTxt);
		//库存数量
		JLabel labelBookStock = new JLabel("库存数量：");
		labelBookStock.setPreferredSize(new Dimension(80, 20));
		add(labelBookStock);
		bookStockTxt = new JLabel("29");
		bookStockTxt.setPreferredSize(new Dimension(width, 20));
		bookStockTxt.setForeground(Color.RED);
		add(bookStockTxt);
	}

}
